#ifndef RENDERWIDGET_H
#define RENDERWIDGET_H

#include <QtGui>
#include <QtOpenGL>
#include "camera.h"
#include "scene.h"

class RenderWidget : public QGLWidget
{
    Q_OBJECT
    
public:
    RenderWidget(QWidget* parent = NULL)
	: QGLWidget(parent), scene(NULL) { setFocusPolicy(Qt::StrongFocus); }
    
	Scene* getScene() { return scene; }
	void setScene(Scene* scene) { if (this->scene) delete this->scene; this->scene = scene; updateGL(); }
	CameraController& getCameraController() { return cameraController; }
	CameraController* getCameraControllerPointer() { return &cameraController; }
	
public slots:
	void dummySearch(QString state);
	void clearSelectionOrSearch();

protected:
    void initializeGL();
    void resizeGL(int w, int h);
    void paintGL();
    
    void keyPressEvent(QKeyEvent* event);
    void mousePressEvent(QMouseEvent* event);
	
protected:
    CameraController cameraController;
    Scene* scene;
};

#endif // RENDERWIDGET_H
